<?php slot('article','active'); ?>
<div class="row-fluid">
				<div class="box span12">
					<div class="box-header">
						<h2><i class="icon-edit"></i>修改文章</h2>
						<div class="box-icon"></div>
					</div>
					<div class="box-content">
              <?php if($sf_user->hasFlash('error')): ?>
              <div class="alert alert-error">
                      <button type="button" class="close" data-dismiss="alert">×</button>
                      <strong>错误！</strong>  <?php echo $sf_user->getFlash('error'); ?>
              </div>
              <?php endif; ?>
              <?php if($sf_user->hasFlash('success')): ?>
              <div class="alert alert-success">
                      <button type="button" class="close" data-dismiss="alert">×</button>
                      <strong>操作成功！</strong> <?php echo $sf_user->getFlash('success'); ?>
              </div>
              <?php endif; ?>
                                          
                                            <form class="form-horizontal" action="<?php echo url_for('article/edit'); ?>" method="post" enctype="multipart/form-data">
                                                <input type="hidden" name="id" value="<?php echo $article->getId(); ?>" />
						  <fieldset>
							<div class="control-group ">
								<label class="control-label" for="focusedInput">主标题</label>
								<div class="controls">
								  <input class="input-xlarge focused" name="title" type="text" value="<?php echo $article->getTitle() ?>" />
                                                                    <span class="help-inline"></span>
								</div>
							  </div>
                                                      <div class="control-group ">
								<label class="control-label" for="focusedInput">作者</label>
								<div class="controls">
								  <select name="author">
                                                                        <?php foreach(Doctrine::getTable('ArticleAuthor')->findAll() as $author): ?>
                                                                        <option value="<?php echo $author->getId(); ?>" 
                                                                                <?php if($author->getId() == $article->getAuthor() ): ?>
                                                                                selected='selected'
                                                                                <?php endif; ?>
                                                                                ><?php echo $author->getName(); ?></option>
                                                                        <?php endforeach; ?>
                                                                    </select>
                                                                    <span class="help-inline"></span>
								</div>
							  </div>
                                                      <div class="control-group">
								<label class="control-label">显示</label>
								<div class="controls">
								  <label class="radio">
								      <input type="radio" name="display" id="month_click" value="0" <?php echo ($article->getDisplay()) ? '' : ' checked=""'; ?> />
									否
								  </label>
								  <div style="clear:both"></div>
								  <label class="radio">
									<input type="radio" name="display" id="day_click" value="1" <?php echo ($article->getDisplay()) ? 'checked=""' : ''; ?> />
									是
								  </label>
								</div>
							  </div>
                            <div class="control-group">
							  <label class="control-label" for="fileInput">文章封面</label>
							  <div class="controls">
								<input class="input-file uniform_on" name="cover" type="file" />
                                                                <span class="help-inline">不修改请不要选择文件</span>
                                                                <br/>
                                                                <img src="<?php echo $article->getCover(); ?>" width="200" height="100" />
							  </div>
							</div>                 
                                                      
                            <div class="control-group hidden-phone">
							  <label class="control-label" for="textarea2">文章摘要</label>
							  <div class="controls">
								<textarea id="edu" name="summary" style="width:650px;height:100px;"><?php echo $article->getSummary() ?></textarea>
							  </div>
							</div>
                            
                            <div class="control-group hidden-phone">
							  <label class="control-label" for="textarea2">正文</label>
							  <div class="controls">
								<textarea id="article_content" name="content" style="width:400px;height:100px;"><?php echo $article->getRaw('content') ?></textarea>
							  </div>
							</div>
                                                      <div class="control-group hidden-phone">
							  <label class="control-label" for="textarea2">手机端正文</label>
							  <div class="controls">
								<textarea id="phone_content" name="phone_content" style="width:400px;height:100px;"><?php echo $article->getRaw('phone_content') ?></textarea>
							  </div>
							</div>
                            <div class="control-group ">
                                <label class="control-label" for="focusedInput">Tag</label>
                                <div class="controls">
                                <input class="input-large focused" name="tags" type="text" value="<?php echo $article->getTag() ?>" style="width:400px;"/>
                                   <span class="help-inline">Tag以逗号间隔</span>
                                </div>
                                </div>
				<div class="form-actions">
							  <input type="submit" class="btn btn-primary" value="保存数据" />
							  <button type="reset" class="btn" onclick="window.location.href='<?php echo url_for('lender/index'); ?>';">返回列表</button>
							</div>
						  </fieldset>
						</form>
					</div>
				</div><!--/span-->

			</div>
<script type="text/javascript">
                var kindedit_options = {
                    'allowFileUpload':true,
                    'width':600,
                    'height':400,
                    'allowFileManager':false,
                    'allowImageUpload':true,
                    'allowMediaUpload':false,
                    'allowFlashUpload':false,
                    'filterMode' : false,
                    'shadowMode':true,
                    'items':  [ 
                                'source', '|', 'undo', 'redo', '|', 'preview','template', 'code', 'cut', 'copy', 'paste',
                                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                                'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
                                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
                                'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
                                'anchor', 'link', 'unlink'
                            ],
                    'uploadJson' : '<?php echo url_for('file/upload') ?>',
                    'fileManagerJson' : '<?php // echo url_for('file/manage') ?>'
                     
                };
                
     KindEditor.create($('#article_content'),kindedit_options);
     KindEditor.create($('#phone_content'),kindedit_options);

</script>